<!DOCTYPE html>
<html lang="en">
<head>

    <meta charset="UTF-8">
    <base href="${request.contextPath}/"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <#import "/spring.ftl" as spring>
    <title><@spring.message code="index.top"/></title>
    <script src="${request.contextPath}/js/jquery-1.11.1.min.js"></script>
    <script src="${request.contextPath}/js/common_click.js"></script>

    <link rel="stylesheet" href="${request.contextPath}/css/index.css">
    <link rel="stylesheet" href="${request.contextPath}/css/common.css">
    <link href="${request.contextPath}/css/zjwd_1440.css" rel="stylesheet" type="text/css"
          media="screen and (max-width: 1919px)">
    <link href="${request.contextPath}/css/zjwd.css" rel="stylesheet" type="text/css"
          media="screen and (min-width: 1919px)">
    <link rel="stylesheet" href="${request.contextPath}/lib/jqueryPagination/css/jquery.pagination.css"/>

    <script src="${request.contextPath}/lib/jqueryPagination/js/jquery.pagination.min.js"></script>
    <style>
        /*----------------------------------------分页--------------------------------*/

        .box {
            width: 700px;
            margin: 0 auto;
            margin-top: 5px;
            height: 34px;
        }

        .page {
            width: 600px;
        }

        .info {
            width: 150px;
            height: 34px;
            line-height: 34px;
            color: white;
        }

        .fl {
            float: left;
        }

    </style>

</head>
<body>
<div class="top_all">
    <p class="top_title"><@spring.message code="index.top"/></p>
    <div class="top_user">
        <div class="user_user">
            <#if isAdmn == "TRUE">
            <div class="top_user_img">
                <img src="${request.contextPath}/images/timg.png" alt="">

            </div>

            <a href="javascript:;" onclick="shouye()">
                <p class="top_user_name"><@spring.message code="index.page"/></p>
            </a>
         </#if>
        </div>

    </div>


    <div class="top_out">
        <div class="out_out">
            <div class="top_out_img">
                <img src="${request.contextPath}/images/icon.png" alt="">

            </div>
            <a href="${request.contextPath}/sy/logout">
                <p class="top_out_name"><@spring.message code="index.out"/></p>
            </a>
        </div>

    </div>


</div>

<div class="content_all">
    <div class="zj_img">
        <div class="zj_img_left"><img src="${request.contextPath}/images/Shape17.png" alt=""></div>
        <div class="zj_img_right"><img src="${request.contextPath}/images/Shape19.png" alt=""></div>
        <div class="zj_img_center">
            <div class="zj_img_box_all">
                <#list zjxx as xxs>

                    <div class="zj_img_box">
                        <img src="${xxs.zjtp}" alt="" >
                        <div class="zj_name">
                            <p>${xxs.zjname}</p>
                            <p style="white-space:nowrap;">${xxs.zjintroduction}</p>
                        </div>
                        <div class="zj_bottom">
                            <div class="zj_bottom_left">
                                <div><img src="${request.contextPath}/images/23.png" alt=""></div>
                                <div>${xxs.plnumber}</div>
                            </div>
                            <div class="zj_bottom_right">
                                <div><img src="${request.contextPath}/images/24.png" alt=""></div>
                                <div>${xxs.dznumber}</div>
                            </div>


                        </div>
                    </div>
                </#list>


            </div>


        </div>


    </div>
    <div class="zjwd">
        <div class="zjwd_title_img">
            <img src="images/f058.png" alt="">
        </div>
        <div class="zjwd_title"><@spring.message code="zjwd.zjwd"/></div>
        <input type="hidden" name="current" id="current" value="1">
        <input type="hidden" name="titleNum" id="titleNum" value="${titleNum}">
        <div class="zjwd_content_all" id="thiszjwd">
            <#list zjwd as wds>
                <div class="zjwd_content">
                    <p class="zjwd_content_tiwen"><span class="tx_img"><img src="${request.contextPath}/images/26.png"></span>
                        <span class="tx_tw" onclick="zjwdxq('${wds.id}');">${wds.wttitle}</span> <span class="tx_time">${wds.createtime?string("yyyy-MM-dd")}</span>
                    </p>
                    <p class="zjwd_content_huida">
                        <span class="tx_img"><img src="${wds.zjtp}" style="width:24.08px; "></span>
                        <span class="tx_hd"
                              style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;">${wds.zjanswer}</span>
                    </p>
                </div>
            </#list>


        </div>
        <div class="fenye">
            <div class="box">
                <div id="pagination3" class="page fl"></div>
                <div class="info fl">
                    <p><@spring.message code="zjwd.dqys"/>：<span id="current3">1</span></p>
                </div>

            </div>
        </div>


    </div>


</div>


<div class="footer_all"></div>

<script src="js/zjwd.js"></script>

<script type="text/javascript">
    function zjwdxq(id) {
        //var ids = $("#spid").val();
        //alert(ids);
        window.location.href = "${request.contextPath}/sy/zjwd/zjwdxq.html?id=" + id;
    }

    $(function () {
        $("#pagination3").pagination({
            currentPage: 1,
            totalPage: 6,
            isShow: true,
            count: 6,
            homePageText: '<@spring.message code="index.page"/>',
            endPageText: '<@spring.message code="zjwd.wy"/>',
            prevPageText: '<@spring.message code="zjwd.syy"/>',
            nextPageText: '<@spring.message code="zjwd.xyy"/>',
            callback: function (current) {
                $("#current3").text(current)
                tiaozhuan( current);
            }
        });
        var current = $('#current').val() - 0;
        var titleNum = $('#titleNum').val() - 0;
        $("#pagination3").pagination("setPage", current, titleNum);
    });

    function tiaozhuan(current) {
        $.ajax({
            type: "post",
            async: true, //异步执行
            url: "${request.contextPath}/sy/zjwd/zjwdfy?current=" + current ,
            dataType: "json", //返回数据形式为json
            success: function (json1) {
                //alert(json.tps);
                // $("#qszqtpul").innerHTML("");
                var json=$.parseJSON(json1);
                $("#thiszjwd").html("");
                var dataObj = json.zjwdAll; //返回的json为json格式的数据
                con = "";

                $("#current").val(json.current);
                $("#titleNum").html(json.titleNum);

                $.each(dataObj, function (index, item) {
                    con += "<div class=\"zjwd_content\">\n" +
                        "                    <p class=\"zjwd_content_tiwen\"><span class=\"tx_img\"><img src=\"${request.contextPath}/images/26.png\"></span>\n" +
                        "                        <span class=\"tx_tw\" onclick=\"zjwdxq('"+item.id+"');\">"+item.wttitle+"</span> <span class=\"tx_time\">"+item.createtime.substring(0,10)+"</span>\n" +
                        "                    </p>\n" +
                        "                    <p class=\"zjwd_content_huida\">\n" +
                        "                        <span class=\"tx_img\"><img src=\""+item.zjtp+"\"></span>\n" +
                        "                        <span class=\"tx_hd\"\n" +
                        "                              style=\"display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;\">"+item.zjanswer+"</span>\n" +
                        "                    </p>\n" +
                        "                </div>";

                });
                console.log(con);    //可以在控制台打印一下看看，这是拼起来的标签和数据
                $("#thiszjwd").html(con); //把内容入到这个div中即完成
                //$(".yx-rotation-focus").empty();
                //$(".yx-rotaion").yx_rotaion({auto: false});
            },
            error: function (errorMsg) {
                alert('<@spring.message code="zjwd.qqsjsb"/>');
            }
        });
    }

</script>
<script>
    $(function () {



        $(".button_click").eq(2).css({backgroundColor: "#43D3FF"})
        $(".button_click").eq(2).children("a").css({color: "#1921BB"})


    })
</script>
<script>

    var zlzs='<@spring.message code="menu.zlzs"/>';
    var zjwd='<@spring.message code="menu.zjwd"/>';
    var nybk='<@spring.message code="menu.nybk"/>';
    var nydsj='<@spring.message code="menu.nydsj"/>';


</script>
<script>
    function shouye(){
        var req = new XMLHttpRequest();
        req.open('GET', document.location, false);
        req.send(null);
        var headers = req.getAllResponseHeaders();
        var local=req.getResponseHeader('content-language');
        if(local=="en-US"){
            local="en_US";
        }else{
            local="zh_CN";
        }
        //alert(local+"-----"+"en_US");
        window.location.href="${request.contextPath}/sy/index/index?locale="+local;
    }
</script>
</body>
</html>




